<?php
/**
 * @file test010.php
 * @package taobaoke
 * @subpackage 
 * @version $id: 0.1 UTF-8 2009-7-19 下午08:39:52 $
 * @author LD King (mifunny.info)
 * @copyright Copyright (c) 2007 - 2009 MiFunny China Inc. (http://mifunny.info)
 * 获取SessionKey的容器地址：http://container.open.taobao.com/container?appkey=12001409 
 * 测试数据获取完整性！ 
 * 
 * http://my.donews.com/ak47/2006/08/03/QMJitGhMEbHXEUGQPdxRfhPUTybKBgynafUZ/
 * Wordpress的XMLrpc
 */

header("Content-Type:text/html;charset=UTF-8");
require_once '../lib/functions.php';

$session = trim($_GET['top_session']);
$dbh = new tbkDB();
echo "Everything begin with ".$session;

$string = "<img src=\"http://img06.taobaocdn.com/bao/uploaded/i6/T1DANjXiSnudNXw63Z_033130.jpg\" alt=\"冲钻特价！个性挑逗扣伴衬衫领情侣 POLO 短袖T恤 四色款\" />";
echo $string."<br /><hr /><br />";
var_dump($string);

/*$item = getTaobaokeItems($session, array('method' => 'keyword', 
										'key' => '雪纺',
										'sort' => 'default',
										'page_size' => 15));

for($i=0; $i<count($item); $i++){
	
	if ($dbh->isExist($item[$i]['iid'], 'items'))
		continue;
	
	$item2 = getTaobaoItem($session, $item[$i]['nick'],$item[$i]['iid']);
	$itemArray = array(
		'iid' => $item[$i]['iid'],
		'title' => $item[$i]['title'],
		'pic_url' => $item[$i]['pic_url'],
		'price' => $item[$i]['price'],
		'click_url' => $item[$i]['click_url'],
		'nick' => $item[$i]['nick'],
		'commission' => $item[$i]['commission'],
		'commission_rate' => $item[$i]['commission_rate'],
		'commission_num' => $item[$i]['commission_num'],
		'commission_volume' => $item[$i]['commission_volume'],
		'cid' => $item2['cid'],
		'title2' => $item2['title2'],
		'location' => $item2['location'],
		'properties' => $item2['properties']
	);
	$dbh->inItem($itemArray);
	echo "<br /><span style=\"color:blue\">入库:</span> ".$item[$i]['title'];
	//var_dump($itemArray);
	
	$shop = getTaobaokeShop($session,$item[$i]['nick']);
	if ($dbh->isExist($shop['user_id'],'shops'))
		continue;
	
	$shopArray = array(
		'user_id' => $shop['user_id'],
		'nick' => $shop['nick'],
		'credit' => $shop['credit'],
		'sex' => $shop['sex'],
		'sid' => $shop['sid'],
		'title' => $shop['title'],
		'desc' => $shop['desc'],
		'created' => $shop['created'],
		'click_url' => $shop['click_url'],
		'shop_commission.rate' => $shop['shop_commission.rate']
	);
	$dbh->inShop($shopArray);
	echo " <span style=\"color:blue\">+店主:</span> ".$shop['nick'];
}*/



?>